<include file="Public/header" />
<title></title>
</head>
<body>
<div class="page-container">
    <form class="form form-horizontal" id="form-article-add">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>账册名称：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder=""  name="name">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>账册编号：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder=""  name="book_no">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>账册类型：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <span class="select-box">
				<select name="type" class="select">
                    <option value="0">---请选择---</option>
                    <option value="1">一般账册</option>
                    <option value="2">跨境账册</option>
                </select>
				</span>
            </div>
        </div>
		<div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>商家编码：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder=""  name="merchant_code">
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <button onClick="save(0)" class="btn btn-secondary radius" type="button"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
                <button onClick="save(1)" class="btn btn-secondary radius" type="button"><i class="Hui-iconfont">&#xe632;</i> 保存并新增</button>
                <button onClick="cancel()" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
<include file="Public/footer_js" />
<script>
    function save(i){
        $.post('__CONTROLLER__/addD',{
            name:$("input[name=name]").val(),
            book_no:$("input[name=book_no]").val(),
			merchant_code:$("input[name=merchant_code]").val(),
            type:$("select[name=type]").val(),
        },function (msg){
            layer.msg(msg.data);
            if(msg.flag==1){
                if(i==0){
                    setTimeout(function (){
                        parent.location.reload();
                        parent.layer.closeAll();
                    },800);
                }else{
                    $("input").prop('value','');
                    $("select").prop('value',0);
                }
            }
        },'json');
    }
    function cancel(){
        parent.layer.closeAll();
    }
</script>
</body>
</html>